// component/plate/plate.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    paddingTop: {
      type: String,
      value: '0'
    },
    paddingBottom: {
      type: String,
      value: '0'
    },
    list: {
      type: Array
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onClick: function (e) {
      var o = e.currentTarget.dataset.open_type;
      if ("tel" == o) {
        var n = e.currentTarget.dataset.tel;
        getApp().core.makePhoneCall({
          phoneNumber: n
        });
      } else {
        var url = e.currentTarget.dataset.url;
        if (url.indexOf('pages/index/index') >= 0 ||
        url.indexOf('pages/cat/cat') >= 0 ||
        url.indexOf('pages/cart/cart') >= 0 ||
        url.indexOf('pages/posts/index') >= 0 ||
        url.indexOf('pages/user/user') >= 0
        ) {
            wx.switchTab({ url })
        } else {
          wx.navigateTo({
            url: url,
          })
        }
      }
      return !1;
    }
  }
})
